Extension to basic McCall model -- response to volatility (#707)#709
Extension to basic McCall model -- response to volatility (#707)#709
Conversation
…707) This commit addresses issue #707 by extending the basic McCall model: - Add "Continuous Offer Distribution" section - Move continuous wage distribution from exercises to main content - Implement lognormal wage distribution with Monte Carlo integration - Show how reservation wage varies with c and β using contour plots - Add "Volatility" section - Demonstrate that reservation wage increases with volatility - Use mean-preserving spread with lognormal distribution - Illustrate how workers prefer more volatile distributions - Update exercise mm_ex1 solution - Change from discrete to continuous distribution - Use JAX implementation with continuous wage draws - Remove exercise mm_ex2 (now covered in main text) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Implementation NotesContinuous Distribution ImplementationThe continuous wage offer distribution uses:
Volatility AnalysisThe mean-preserving spread is achieved by adjusting μ when varying σ:
Code Quality
TestingTested via
The file is ready for review and merge. |
|
📖 Netlify Preview Ready! Preview URL: https://pr-709--sunny-cactus-210e3e.netlify.app (2ea4ce0) 📚 Changed Lecture Pages: mccall_fitted_vfi, mccall_model |
- Add new section showing expected lifetime value increases with volatility - Implement parallel JAX code for simulating job search with optimal policy - Use jax.vmap to vectorize 10,000 simulation replications - Compute reservation wage and lifetime value across volatility levels - Plot demonstrates option value of search under uncertainty - Fix LaTeX escape sequence warnings in xlabel (use raw strings) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Added new section "Lifetime Value and Volatility" that demonstrates how expected lifetime value increases with volatility under the optimal policy. ImplementationThe section includes:
Key ResultsFor each volatility level:
The code runs without warnings and complements the existing volatility section that shows reservation wages increase with σ. 🤖 Generated with Claude Code |
- Replace while_loop with fixed-period simulation (100 periods) - Draw all wage offers upfront using vectorized operations - Use cumsum to track employment status from first acceptance - Simpler logic that's easier to parallelize (same path length) - Cleaner code without nested loop functions - Update description to reflect simplified approach 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
📖 Netlify Preview Ready! Preview URL: https://pr-709--sunny-cactus-210e3e.netlify.app (905151e) 📚 Changed Lecture Pages: mccall_fitted_vfi, mccall_model |
|
Simplified the lifetime value simulation for better parallelization: ChangesReplaced the Before: Used Key Improvements
Code Structure# Draw 100 wage offers upfront
wage_offers = jnp.exp(μ + σ * s_vals)
# Track employment from first acceptance onward
employed = jnp.cumsum(wage_offers >= w_bar) > 0
# Compute earnings and discounted sum
earnings = jnp.where(employed, accepted_wage, c)
lifetime_value = jnp.sum(discount_factors * earnings)This approach is cleaner and more efficient for parallel JAX execution, while 100 periods provides sufficient accuracy given β=0.99. 🤖 Generated with Claude Code |
|
📖 Netlify Preview Ready! Preview URL: https://pr-709--sunny-cactus-210e3e.netlify.app (326b343) 📚 Changed Lecture Pages: mccall_fitted_vfi, mccall_model |
|
📖 Netlify Preview Ready! Preview URL: https://pr-709--sunny-cactus-210e3e.netlify.app (e609076) 📚 Changed Lecture Pages: mccall_fitted_vfi, mccall_model |
This PR addresses issue #707 by extending the basic McCall model to include continuous wage distributions and volatility analysis.
Changes
1. New "Continuous Offer Distribution" Section
2. New "Volatility" Section
Key insight: Workers prefer more volatile wage distributions because they can accept high offers while rejecting low ones, leading to higher reservation wages.
3. Updated Exercise mm_ex1
compute_stopping_time_continuous()with lognormal wages4. Removed Exercise mm_ex2
Testing
jupytext --to pyCloses #707